<!DOCTYPE html>
<html style="background: #f7f7f7;">
<head lang="en">
    <meta charset="UTF-8">
    <meta name='apple-touch-fullscreen' content='yes'>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta content="fullscreen=yes,preventMove=no" name="ML-Config">
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>首页</title>
    <link rel="stylesheet" href="/style/wei/css/swiper.min.css">
    <link rel="stylesheet" href="/style/css/style1.css?ver=20191206">
    <link rel="stylesheet" type="text/css" href="/style/rcm/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/style/rcm/css/xshop.css?ver=20191206"/>
    <script src="/style/js/index/style.js"></script>
    <script src="/style/js/hhSwipe.js"></script>
    <script src="/style/js/index/swiper.min.js"></script>
    <script src="style/wei/js/jquery.min.js"></script>
    <script type="text/javascript" src="/style/new/js/jquery.lazyload.js"></script>
    <script type="text/javascript" src="/style/wei/js/jquery.cookies.js"></script>
    <style>
        .detail_twoBox{width:100%;position: relative;}
        .detail_ban{ position: relative; width: 100%; overflow: hidden;}
        .detail_two{position:relative;display: block;}
        .detail_two li{float: left;}
        .detail_two li a{display:block;width:100%;}
        .detail_two li img{ width:100%; display: block;}
        .num{position:absolute;left:0.68rem;bottom:0.35rem;z-index: 999;display: flex;align-items: center;}
        .num li{ display:inline-block;width:0.09rem;height:0.09rem;border-radius:50%;background:#fff;margin-right: 0.13rem;}
        .num .active{background-color:#8ed6ee;width: 0.18rem;height: 0.07rem;border-radius: 0.03rem;}
        .nostock{ position: absolute; top: 0; z-index: 999; background: #fff; width: 2rem; height: 2rem; line-height: 2rem; color: #fff; border-radius: 2rem; background-color: rgba(235, 41, 148, 0.5)!important; filter: Alpha(opacity=50); background: #EB2994; text-align: center; font-size: .5rem; margin: 15% auto; right: 0; left: 0;}
        .more { float: left; width: 100%; height: auto; padding: .2rem 0; background: #fff;}
        .more .zhekou, .more .sheng { margin-left: .2rem; float: left; width: auto; background: #fff; border: 1px solid #555; color: #555; text-align: center; padding: 0 .1rem; line-height: 24px; height: 24px; border-radius: 0 5px;  /*  margin: 0 .2rem 0 0.2rem;*/ font-size: .2rem;}
        .more .share { float: left; width: 2rem; height: .5rem; line-height: .5rem; text-align: center; border:1px solid #c40000; color: #c40000; font-size: .3rem; border-radius: 0 5px; margin-left: .2rem;}
        .more .warehouse { float: left; width: auto; margin: 0 .2rem 0 0;}
        .more .warehouse u { float: left; width: .5rem; text-decoration: none; border-radius: 0 0 0 5px; color: #fff; height: 24px;}
        .more .warehouse i { float: left; width: auto; background: #fff; border: 1px solid #666; color: #666; font-size: .25rem; height: 24px; line-height: 24px; padding: 0 .1rem; border-radius: 0 5px 0 0;}
        .more .warehouse.baoshui u { border: 1px solid #0080FF; background: url(/style/new/images/icon_warehouse.png) no-repeat #0080FF; background-size: .4rem .4rem; background-position: 2px 0;}
        .more .warehouse.baoshui i { border: 1px solid #0080FF; color: #0080FF;}
        .more .warehouse.bendi u { border: 1px solid #00C100; background: url(/style/new/images/icon_warehouse.png) no-repeat #00C100; background-size: .4rem .4rem; background-position: 2px 0;}
        .more .warehouse.bendi i { border: 1px solid #00C100; color: #00C100;}
        .more .warehouse.haiwai u { border: 1px solid #B200B2; background: url(/style/new/images/icon_warehouse.png) no-repeat #B200B2; background-size: .4rem .4rem; background-position: 2px 0;}
        .more .warehouse.haiwai i {border: 1px solid #B200B2;color: #B200B2;}
        .foot-menu ul{ height: 1rem; }
        .syList{ display: flex;align-items: center; }
        .syList-left{ margin-right: 0.16rem;display: flex;align-items: flex-end;float: left; }
        .syList-left i{ font-size: 0.22rem;color: #f75015;margin-bottom: 0.01rem }
        .syList-left i.gray{color: #333; font-size: .25rem; padding-left: .2rem;}
        .syList-left em{ color: #f75015;font-size: 0.32rem; }
        /*.syList-center{ font-size: 0.22rem;color: #999;text-decoration: line-through;float: left; }*/
        .syList-right{ background: #da251e;/*width: 1.82rem;*/height: 0.50rem; float: right;border-radius: 0.3rem;padding: 0 0.20rem;display: flex;justify-content: space-between;align-items: center;overflow: hidden;}
        .syList-right img{ width: 0.33rem;height: 0.32rem; }
        .syList-right i{ font-size: 0.20rem;color: #fff;    border-left: 2px solid#dd3a34;padding: 0.05rem 0 0.05rem 0.1rem;margin-left: 0.1rem; }
        /*.sy-flex{ background-color: #fff;display: flex;align-items: center;justify-content: space-between;    padding:0.27rem;}*/
        /*.theme-popover { background: #FFFFFF; position: absolute; position: fixed; width: 100%; height: 100%; top: 0; left: 0;background: rgba(0, 0, 0, .6);z-index: 100000;display: none;}*/
        /*.theme-buy { position: fixed; width: 100%; z-index: 4;}*/
        .theme-buy img{  border-bottom: 1px solid #f2f2f2;}
        /*.theme-popbod { text-align: center;color: #fff;}*/
        .theme-popbod p { display: block; width: 100%; text-align: center; font-size: .3rem; line-height: 30px; margin-bottom: 40px; color: #fff;}
        .theme-poptit p { display: block; -webkit-margin-before: 1em; -webkit-margin-after: 1em; -webkit-margin-start: 0px; -webkit-margin-end: 0px;}
        .theme-popbod img { padding-top: 50%;text-align: center;}
        /*.theme-buy {padding-top: .81rem;width: 100%;}*/
        .theme-buy img { width: 100%;}
        /*.theme-poptit { display: block; text-align: center;}*/
        .theme-poptit p { color: #fff; font-size: 1.5rem;}
        /*#nav { width:80%;  height: 40px;  position:fixed; left:20%;top:4rem; background-color:#0066FF ; text-align: center;border-radius: 50px 50px 50px 50px;z-index: 999999;display: none;}*/
        #nav span{ font-size:14px; color:#fff }
        #nav img{ display: block; width:40px; height:40x; border-radius:100%; overflow: hidden;}
        .sy-title{ background: #fff;padding: 0.38rem 0;width: 100%; }
        .sy-title-left{ display: flex;align-items: flex-end;justify-content: center;padding-bottom: 0.1rem; }
        .sy-title-left i{ width: 0.30rem;height: 0.03rem;background: #e7716d;margin-bottom: 0.1rem; }
        .sy-title-left b{ font-size: 0.42rem;color: #da251e; padding: 0 0.10rem; }
        .sy-title-right{ font-size: 0.16rem;color: #999;text-align: center;padding-bottom: 0.12rem  ;height: 0.18rem;line-height: 0.18rem; }
        /*客服*/
        /*.content-bg{ background: url("/style/lh/images/sy-bg.png") no-repeat;width: 100%;height: 5.51rem;background-size: 100% 100%;    position: relative; }*/
        .content-bg h3{ font-size: 0.41rem;color: #da251e;text-align: center;font-weight: bold;padding: 0.45rem 0 0.15rem; }
        .content-bg h4{ font-size: 0.18rem;color: #666;text-align: center; }
        .content-bg h5{ width: 0.40rem;height: 0.05rem;background: #da251e;margin: 0.12rem auto 0;  }
        /*.content-bottom{ margin-bottom: 0.8rem;background: #fff; }*/
        /*.content-view{  }*/
        /*.content-titile{ padding: 0.05rem 0;background: #da251e;overflow: hidden;}*/
        .content-titile h3{ text-align: center;color: #fff;font-size: 0.26rem;padding: 0.10rem 0;border-bottom: 0.02rem dashed #fff;border-top: 0.02rem dashed #fff;    font-style: initial;margin: 0; }
        .content-bottom dl dt{ width: 1.46rem;/*height: 0.43rem;*/background: #ee9c99;text-align: center;/*line-height: 0.43rem;*/color: #fff;font-size: 0.21rem;margin: 0.46rem auto 0.33rem; font-style: initial;display: flex;justify-content: center;align-items: center; }
        .content-bottom dl dd{font-size: 0.21rem;height: 0.21rem;color: #222;text-align: center;margin-bottom: 0.28rem;font-style: initial;line-height: 0.21rem;}
        .content-bottom dl dd:first-child{ margin-bottom: 0;}
        .content-bottom dl dd:last-child{padding-bottom: 0.8rem;}
        /*.content-view-top{ margin-top: 0.58rem;overflow: hidden; }*/
        /*.sy-h6{ color: #333333;font-size: 0.25rem;font-style: initial;}*/
        /*.sy-h2{color: #da251e;font-size: 0.28rem;font-weight: bold;}*/
        /*.sy-h2:link{color: #da251e;  }*/
        /*.sy-h2:visited{color: #da251e;  }*/
        /*.sy-h2:hover{color: #da251e;  }*/
        /*.sy-h2:active{color: #da251e;  }*/
        /*.sy-list-img{ width: 100%;height: 0.42rem;    position: absolute;bottom: 0.50rem;}*/
        .content-main img{ width: 0.33rem;height: 0.28rem;float: left;margin-right: 0.12rem; }
        /*.content-main{width: 3rem;float: right;margin-right: 1rem;display: flex;align-items: center;margin-bottom: 0.40rem;}*/
        /*.content-main-right{border-left: 0.01rem solid#d7d4d4;width: 2.3rem;padding-left: 0.14rem;float: left;}*/
        /*.jplist{display: flex;align-items: center;width:100%;float: left;}*/
        .jplist i{color: #333; font-size: .25rem; padding-left: .2rem;}
        .num {
            position: absolute;
            left: 0.68rem;
            bottom: 0.35rem;
            z-index: 999;
            display: flex;
            align-items: center;
        }
        .num .swiper-pagination-bullet {
            display: inline-block;
            width: 0.09rem;
            height: 0.09rem;
            border-radius: 50%;
            background: #fff;
            margin-right: 0.13rem;
            opacity: 1;
        }
        .num .swiper-pagination-bullet-active {
            background-color: #8ed6ee;
            width: 0.18rem;
            height: 0.07rem;
            border-radius: 0.03rem;
        }
        .s_search button{    font-size: 0.26rem;
            float: right;
            border: none;
            outline: none;
            color: #000;
            background: #fff;
            width: 0.7rem;
            text-align: center;    height: 100%;
            border-radius: 0.16rem;
        }
        .kf_popup{ width: 100%;height: 100%;position: fixed;top: 0;z-index: 99999;right: 0;left: 0;background: rgba(0,0,0,0.3) ;display: flex;justify-content: center;align-items: center;}
        .kf_main{ width: 6.46rem;height: 3.5rem;background: #fff;border-radius: 0.12rem; }
        .kf_top{ overflow: hidden;padding-top: 0.24rem; }
        .kf_title{ width: 6.46rem;height: 1.01rem;border-top-left-radius: 0.12rem;border-top-right-radius: 0.12rem; }
        .kf_nav{ width: 6.46rem;height: 0.79rem; }
        .kf_view h3{ display: flex;align-items: center;margin-bottom: 0.26rem; }
        .kf_view h3 a{ font-size: 0.33rem;color: #ea002a;width: 2.56rem;display: inline-block;overflow: hidden;text-align: left; }
        .kf_view img{ width: 3.44rem;height: 0.45rem; }
    </style>
</head>
<div class="meinner-adr-add">
    <div class="s_top">
        <div class="scroll relative">
            <div class="index_box jz640">
                <div class="swiper-container">
                    <ul class="swiper-wrapper">
                        <?php
                        if($this->data['advList1']){
                            foreach($this->data['advList1'] as $r){
                                ?>
                                <li class="swiper-slide"><a href="<?=$r['url']? : 'javascript:;';?>"><img src="<?= $r['pic']?>" alt='ban2'></a></li>
                                <?php
                            }
                        }
                        ?>
                    </ul>
                    <!-- Add Pagination -->
                    <div class="num"></div>
                </div>
            </div>
            <div class="s_head">
                <a href="#" class="s_kf"><img src="/style/images/index/s_1.png" alt=""></a>
                <form id="forms" action="/index/goodslist" method="get">
                    <div class="s_search">
                        <img src="/style/images/index/s_3.png" alt="">
                        <input type="hidden" name="uid" value="<?=$this->user['uid']?>">
                        <input type="text" placeholder="请输入搜索关键词" name="keywords" id="forms">
                        <button>搜索</button>
                    </div>
                </form>
                <!-- <a href="#" class="s_lt"><img src="/style/images/index/s_2.png" alt=""></a> -->
            </div>
        </div>
        <div class="s_menu">
            <ul>
                <?php
                if($this->data['advList5']){
                    foreach($this->data['advList5'] as $r){
                        ?>
                        <li>
                            <a href="<?=$r['url']? : 'javascript:;';?>"><img src="<?= $r['pic']?>" alt=""><span><?= $r['title']?></span></a>
                        </li>
                        <?php
                    }
                }
                ?>
            </ul>
            <?php
            if($this->data['advList2']){

                ?>
                <a href="<?=$this->data['advList2']['url']? : 'javascript:;';?>" class="s_menuLink">
                    <img src="<?= $this->data['advList2']['pic']?>" alt="">
                </a>

                <?php

            }
            ?>

            <dl>
                <?php
                if($this->data['advList3']){
                    foreach($this->data['advList3'] as $r){
                        ?>
                        <dt><a href="<?=$r['url']? : 'javascript:;';?>"><img src="<?= $r['pic']?>" alt=""></a></dt>

                        <?php
                    }
                }
                ?>
                <?php
                if($this->data['advList4']){
                    foreach($this->data['advList4'] as $r){
                        ?>
                        <dd><a href="<?=$r['url']? : 'javascript:;';?>"><img src="<?= $r['pic']?>" alt=""></a></dd>
                        <?php
                    }
                }
                ?>
            </dl>
        </div>
    </div>

    <div class="hot-sale" style="margin-bottom: 1rem;">
        <div class="sy-title">
            <div class="sy-title-left">
                <i></i>
                <b>爆款热卖</b>
                <i></i>
            </div>
            <div class="sy-title-right" style="padding-bottom: 0">HOT&nbsp;&nbsp;PRODUCT</div>
        </div>
        <?php
        if($this->data['advList6'])
        {
            //echo 111;die;
            foreach($this->data['advList6'] as $k=> $r){


                $goods = $this->data['goods'][$r['goods_id']];
                ?>

                <div class="hot-sale-main">
                    <a href="/index/goodsdetail?goods_id=<?=$r['goods_id']?>" >
                        <div class="hot-sale-main-pic">
                            <!-- lazycover.jpg -->
                            <!-- <img src="/style/lh/images/sy6.png" class="sy6"> -->
                            <img src="/style/images/lazycover.jpg" class="lazyimg" data-original="<?= $r['pic']?>" />
                        </div>
                        <div class="sy_flexx" style="background: #fff; padding: .24rem;overflow: hidden;">
                            <h4 style=" color: #333;font-size: .3rem;width: 100%;line-height: .44rem;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"><?= $r['title']?></h4>
                            <div style="display: flex;align-items: center;justify-content: space-between;">
                                <div class="syList">
                                    <div class="syList-left">
                                        <i>￥</i>
                                        <em><?=$goods['shop_price']?></em>
                                        <i class="gray"><?php
                                            // / 返100, 券7
                                            /* if($goods['price_me'] >0 || $goods['coupon_price']>0)
                                             {
                                                 echo '/ ';
                                                 if($goods['price_me'] >0)
                                                 {
                                                     echo '返'.($goods['price_me'] * 1);
                                                 }
                                                 if($goods['coupon_price'] >0)
                                                 {
                                                     echo ' 抵券'.$goods['coupon_price'];
                                                 }
                                             }*/
                                            ?></i>
                                    </div>

                                    <div class="more">

                                        <!-- --><?php
                                        /*                                    if($goods['price_me'] >0)
                                                                            {
                                                                            echo '<div class="zhekou">返'.($goods['price_me'] * 1).'</div>';
                                                                            }

                                                                            if($goods['coupon_price'] >0)
                                                                            {
                                                                               echo  '<div class="sheng">抵券'.$goods['coupon_price'].'</div>';
                                                                            }
                                                                            */?>
                                        </divclass>
                                    </div>
                                </div>
                                <div class="syList-right">
                                    <img src="/style/lh/images/sy4.png" alt="">
                                    <i >立即购买</i>
                                </div>
                            </div>
                        </div>
                    </a>
                </div>

                <?php
            }}
        ?>
    </div>
</div>
<?php
if($this->config['special_status']==1){
    ?>
    <div class="s_main">
        <div id="top" class="top" style="width: 100%; top: 0px; position: relative;">
            <div class="s_nav">
                <h4>今日特卖</h4>
                <h6>PREFERRED CUISINE</h6>
            </div>
            <div class="swiper-container swiper1">
                <div class="swiper-wrapper">
                    <?php
                    if ($this->data['special']) {
                        foreach ($this->data['special'] as $k => $r) {
                            ?>
                            <div class="swiper-slide <?= $k == 0 ? 'selected' : '' ?> today-special"
                                 data-id="<?= $r['id'] ?>" onClick="special_goods(<?= $r['id'] ?>)"><i><?= $r['time'] ?></i><span><?= $r['status_name'] ?></span>
                            </div>
                            <?php
                        }
                    }
                    ?>
                </div>
            </div>
        </div>
        <!-- swiper2 -->
        <div class="swiper-container swiper2">
            <div class="swiper-wrapper">
                <div class="swiper-slide swiper-no-swiping">
                    <div class="s_view">
                        <ul class="s_list" id="goods_list">

                            <!--<li>
                                <a href="#">
                                    <img src="/style/images/index/images/s_19.png" alt="">
                                    <div class="s_listA">
                                        <div class="s_listA_left">
                                            <h4>蜂花小麦蛋白护发素2瓶</h4>
                                            <h3>经典国货 尽享丝滑 增洗发水</h3>
                                        </div>
                                        <div class="s_listA_right">
                                            <h3><i>￥</i><em>39.9</em></h3>
                                            <h4>￥99.9</h4>
                                        </div>
                                    </div>
                                </a>
                            </li>-->

                        </ul>
                    </div>
                </div>
                <div class="swiper-slide swiper-no-swiping"></div>

            </div>
        </div>
    </div>
    <?php
}
?>

<div class="foot-menu">
    <ul class="clearfix">
        <li class="on"><a href="/"><i class="ico-7"></i><span>首页</span></a></li>
        <li ><a href="/rcm"><i class="ico-1"></i><span>商城</span></a></li>
        <li><a href="/cart/cart"><i class="ico-5"></i><span>购物车</span></a></li>
        <li><a href="/college"><i class="ico-8"></i><span>商学院</span></a></li>
        <li><a href="/user/index"><i class="ico-4"></i><span>我的</span></a></li>
    </ul>
</div>
<!--客服弹窗-->
<div class="kf_popup" style="display: none">
    <div class="kf_main">
        <div class="kf_top">
            <img src="/style/images/a1.png" alt="" class="kf_title">
            <img src="/style/images/a2.png" alt="" class="kf_nav">
        </div>
        <div class="kf_view">
            <h3><img src="/style/images/a3.png" alt=""><a href="tel:<?=$this->config['service_moblie'] ?:'';?>"><?=$this->config['service_moblie'] ?:'';?></a></h3>
            <h3><img src="/style/images/a4.png" alt=""><a href="tel:<?=$this->config['service_phone'] ?:'';?>"><?=$this->config['service_phone'] ?:'';?></a></h3>
        </div>
    </div>
</div>
<script>
    $(function(){
        $(".s_kf").click(function () {
            $(".kf_popup").show();
        })
        $(".kf_popup").click(function () {
            $(".kf_main").click(function () {
                $(".kf_popup").show();
            })
            $(".kf_popup").hide();
        })
        $('#forms').submit(function(){
        });
        /*懒加载*/
        $(".lazyimg").lazyload({
            container:".meinner-adr-add",
            threshold : 150,
            placeholder : "/style/images/lazycover.jpg",
            failurelimit : 4
        });

        var id = $(".today-special").eq(0).attr("data-id");
        special_goods(id);

        // 这是首页 轮播
        var mySwiper = new Swiper('.swiper-container', {
            autoplay: true,//等同于以下设置
            pagination: {
                el: '.num',
                clickable: true,
            },
        });

        //主要用于当调整浏览器窗口的大小时文档也相应调整
        $(window).resize(function() {
            boxW=$(".detail_twoBox").width();//获取改变后的窗口大小
            detail_ban.css({width:len*boxW});//设置ban外边框宽度
            detail_ban_li.css({width:100/len+"%"});//设置li宽度
        });
        // startMove();//启动js
    })
    window.onload = function () {
        var pos =  $('#top').offset();// offset() 获得div1当前的位置，左上角坐标(x,y)
        $(window).scroll(function () { //滚动条滚动事件
            if ($(this).scrollTop() > pos.top ) {
                $('#top').css('width', '100%').css('top', $(this).scrollTop() - pos.top);
            }
            else if ($(this).scrollTop() <=  pos.top ) {
                $('#top').css('width', '100%').css('top',0).css('position', 'relative').css('z-index', '999');
            }
        })
    };
    $(function() {

        <?php
        if($this->config['special_status']==1) {
        ?>
        function setCurrentSlide(ele, index) {
            $(".swiper1 .swiper-slide") . removeClass("selected");
            ele . addClass("selected");
            //swiper1.initialSlide=index;
        }


        swiper1 = new Swiper('.swiper1', {
//					设置slider容器能够同时显示的slides数量(carousel模式)。
//					可以设置为number或者 'auto'则自动根据slides的宽度来设定数量。
//					loop模式下如果设置为'auto'还需要设置另外一个参数loopedSlides。
            slidesPerView:
                5.5,
            paginationClickable: true,//此参数设置为true时，点击分页器的指示点分页器会控制Swiper切换。
            spaceBetween: 10,//slide之间的距离（单位px）。
            freeMode: true,//默认为false，普通模式：slide滑动时只滑动一格，并自动贴合wrapper，设置为true则变为free模式，slide会根据惯性滑动且不会贴合。
            loop: false,//是否可循环
            onTab: function (swiper) {
                var
                    n = swiper1 . clickedIndex;
            }
        });
        swiper1 . slides . each(function (index, val) {
            var
                ele = $(this);
            ele . on("click", function () {
                setCurrentSlide(ele, index);
                swiper2 . slideTo(index, 500, false);
                //mySwiper.initialSlide=index;
            });
        });
        <?php
        }
        ?>
        /*            var swiper2 = new Swiper('.swiper2', {
                        //freeModeSticky  设置为true 滑动会自动贴合
                        direction: 'horizontal',//Slides的滑动方向，可设置水平(horizontal)或垂直(vertical)。
                        loop: false,
        //					effect : 'fade',//淡入
                        //effect : 'cube',//方块
                        //effect : 'coverflow',//3D流
        //					effect : 'flip',//3D翻转
                        autoHeight: true,//自动高度。设置为true时，wrapper和container会随着当前slide的高度而发生变化。
                        onSlideChangeEnd: function(swiper) {  //回调函数，swiper从一个slide过渡到另一个slide结束时执行。
                            var n = swiper.activeIndex;
                            setCurrentSlide($(".swiper1 .swiper-slide").eq(n), n);
                            swiper1.slideTo(n, 500, false);
                        }
                    });*/
    });



    function special_goods(id)
    {

        if(id){
            $.ajax({
                url:'/index/ajaxSpecial',
                type:'post',
                data:{"id":id,"mr":Math.random()},
                dataType:'json',
                success:function(data){

                    var htmls = "";
                    //alert(JSON.stringify(data))
                    if(data != '' && data !=null){

                        $.each(data,function(index,value){

                            var number = "";
                            if(value.stock_number <1){

                                number = '<div class="nostock">补货中</div>'
                            }

                            htmls += '<li><a href="/index/goodsdetail?goods_id='+value.goods_id+'"><img src="'+value.img+'" />';
                            htmls += '<div class="s_listA"><div class="s_listA_left"><h4>'+value.goods_name+'</h4>';
                            htmls += '<h3>'+value.goods_title+'</h3></div>';
                            htmls += '<div class="s_listA_right"><h3><i>￥</i><em>'+value.shop_price+'</em></h3><h4>￥'+value.market_price+'</h4></div></div></a>'+number+'</li>';
                        })

                        $('#goods_list').html(htmls);
                        /*$(".lazyimg").lazyload({
                            container:".in-mian4",
                            threshold : 150,
                            placeholder : "/style/new/images/lazyload_cover.gif",
                            failurelimit : 4
                        });*/

                    }else{

                        $('#goods_list').html("");
                    }



                },
                error:function(res){
                    console.log(res)
                }
            })

        }

    }
</script>

<?php
if($this->JSAPI){

    ?>
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script>

        wx.config({
            appId: '<?=$this->JSAPI['appId'];?>',
            timestamp: '<?=$this->JSAPI['timestamp'];?>',
            nonceStr: '<?=$this->JSAPI['nonceStr'];?>',
            signature: '<?=$this->JSAPI['signature'];?>',
            jsApiList: [
                'onMenuShareTimeline', //分享到朋友圈
                'onMenuShareAppMessage' //分享给朋友
            ]
        });
        wx.checkJsApi({
            jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
            success: function(res) {
                // 以键值对的形式返回，可用的api值true，不可用为false
                // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
                // alert(res);
            }
        });
        wx.ready(function () {
            wx.onMenuShareAppMessage({
                title: '西海良品',
                desc: '绿色富硒、好吃不贵的优质农产品，自用省钱、分享返钱，共建共享。社区连锁店 欢迎加盟.....',
                link: '<?=$this->JSAPI['url'];?>',
                imgUrl: 'http://<?=$_SERVER['HTTP_HOST'];?>/style/wei/images/tuijian/tj_logo_big2.jpg',
                type: 'link',
                dataUrl: '',
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

            // 分享到朋友圈
            wx.onMenuShareTimeline({
                title: '西海良品', // 分享标题
                link: '<?=$this->JSAPI['url'];?>',
                imgUrl: 'http://<?=$_SERVER['HTTP_HOST'];?>/style/wei/images/tuijian/tj_logo_big2.jpg',
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

        });
    </script>
    <?
}
?>
</body>
</html>